#include <iostream>
#include <algorithm>
using namespace std;

int n, m, a[2000001];

int main()
{
    cin >> n >> m;
    for(int i = 1; i <= m; i++) cin >> a[i];
    sort(a, a + m);
    for(int i = 1; i <= m; i++) cout << a[i] << " ";
    return 0;
}